import type {
  CaptchaStatusResponse,
  SliderCaptchaParams,
  SliderCaptchaResponse,
  VerifyCaptchaParams,
  VerifyCaptchaResponse,
} from '@/api/interface/system/admin/login'
import { ADMIN_MODULE } from '@/api/helper/prefix'
import { http } from '@/utils/http'

// 获取验证码状态
export function getCaptchaStatus() {
  return http.get<CaptchaStatusResponse>(`${ADMIN_MODULE}/captcha/status`)
}

// 获取滑块验证码
export function getSliderCaptcha(params: SliderCaptchaParams) {
  return http.post<SliderCaptchaResponse>(`${ADMIN_MODULE}/captcha/get`, params)
}

// 验证滑块验证码
export function verifyCaptcha(params: VerifyCaptchaParams) {
  return http.post<VerifyCaptchaResponse>(`${ADMIN_MODULE}/captcha/check`, params)
}
